home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / tcl / expecTerm / global.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-17  |  4.2 KB  |  148 lines  |  [TEXT/MPS ]

  1. /* global.h - global definitions
  2. ***************************************************************************** 
  3. expecTerm version 1.0 beta
  4. Mark Weissman
  5. Christopher Matheus
  6. Copyright 1992 by GTE Laboratories Incorporated.
  7.  
  8. Portions of this work are in the public domain.  Permission to use,
  9. copy, modify, and distribute this software and its documentation for
  10. any purpose and without fee is hereby granted, provided that the above
  11. copyright notice appear in all copies and that both the copyright
  12. notice and warranty disclaimer appear in supporting documentation, and
  13. that the names of GTE Laboratories or any of their entities not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.
  16.  
  17. GTE disclaims all warranties with regard to this software, including
  18. all implied warranties of merchantability and fitness for a particular
  19. purpose, even if GTE Laboratories Incorporated knows about the
  20. purpose.  In no event shall GTE be liable for any special, indirect or
  21. consequential damages or any damages whatsoever resulting from loss of
  22. use, data or profits, whether in an action of contract, negligence or
  23. other tortuous action, arising out of or in connection with the use or
  24. performance of this software.
  25.  
  26. This code is based on and may include parts of Don Libes' expect code:
  27.   expect written by: Don Libes, NIST, 2/6/90
  28.   Design and implementation of expect was paid for by U.S. tax
  29.   dollars.  Therefore it is public domain.  However, the author and NIST
  30.   would appreciate credit if this program or parts of it are used.
  31. ******************************************************************************
  32.  
  33.  
  34. Written by: Don Libes, NIST, 2/6/90
  35. Modified by: Mark Weissman 9/92
  36.  
  37. Design and implementation of this program was paid for by U.S. tax
  38. dollars.  Therefore it is public domain.  However, the author and NIST
  39. would appreciate credit if this program or parts of it are used.
  40. */
  41.  
  42. #ifndef FALSE
  43. #define FALSE 0
  44. #endif
  45. #ifndef TRUE
  46. #define TRUE 1
  47. #endif
  48.  
  49. /* MDW: Mon Jun 22 14:38:47 1992 */
  50. #ifndef mS_PER_SEC
  51. #define mS_PER_SEC      (1000L)
  52. #endif
  53. #ifndef uS_PER_mS
  54. #define uS_PER_mS       (1000L)
  55. #endif
  56. #ifndef uS_PER_SEC
  57. #define uS_PER_SEC      (1000000L)
  58. #endif
  59. #ifndef NS_PER_mS
  60. #define NS_PER_mS    (NS_PER_SEC/mS_PER_SEC)
  61. #endif
  62.  
  63. #ifndef TIME_INFINITY
  64. #define TIME_INFINITY    -1.0
  65. #endif
  66. /* MDW: Mon Jun 22 14:38:47 1992 */
  67.  
  68. extern char *sys_errlist[];
  69. int errno;    /* some but not all systems require this */
  70.  
  71. /* if you get errors from the compiler here, add -DNOSTDLIB to Makefile */
  72. #ifdef NOSTDLIB
  73.     char* malloc();
  74.     char* realloc();
  75. #ifndef _TCLINT
  76.     void exit();
  77. #endif
  78. #else
  79. #include <stdlib.h>
  80. #endif
  81.  
  82. /* yes, I have a weak mind */
  83. #define streq(x,y)    (0 == strcmp((x),(y)))
  84.  
  85. #ifdef NO_MEMCPY
  86. #define memcpy(x,y,len) bcopy(y,x,len)
  87. #endif
  88.  
  89. #ifndef TERM
  90. #  ifdef POSIX
  91. #    define TERM termios
  92. #  endif
  93. #endif
  94.  
  95. #ifndef TERM
  96. #  ifdef SYSV3
  97. #    ifdef HPUX
  98. #      define TERM termio
  99. #    else
  100. #      define TERM termios
  101. #    endif
  102. #  else
  103. #      define TERM sgttyb
  104. #  endif
  105. #endif
  106.  
  107. typedef struct TERM exp_tty;
  108.  
  109. char *cook();
  110. char *printify();
  111. #define dprintify(x)    ((is_debugging || debugfile)?printify(x):0)
  112. /* in circumstances where "debuglog(printify(...))" is written, call */
  113. /* dprintify instead.  This will avoid doing any formatting that would */
  114. /* occur before debuglog got control and decided not to do anything */
  115. /* because (is_debugging || debugfile) was false. */
  116.  
  117. void Log();
  118. void errorlog();
  119. void exp_debuglog();
  120. void nflog();
  121. void nferrorlog();
  122. void tty_raw();
  123. void tty_echo();
  124. void tty_set();
  125. void flush_streams();
  126. void bye();
  127.  
  128. #ifdef _TCL
  129. extern Tcl_Interp *interp;
  130. #endif
  131.  
  132. extern FILE *cmdfile;
  133. extern FILE *debugfile;
  134. extern FILE *logfile;
  135.  
  136. extern int logfile_all;
  137. extern int loguser;
  138.  
  139. extern int is_debugging;    /* useful to know for avoid debug calls */
  140.  
  141. /* yet more TCL return codes */
  142. /* Tcl does not safely provide a way to define the values of these, so */
  143. /* use ridiculously numbers for safety */
  144. #define TCL_CONTINUE_EXPECT    -101    /* continue expect command itself */
  145. #define TCL_RETURN_TCL        -102    /* converted by interact, interpeter */
  146.                     /* from "return -tcl" into TCL_RETURN */
  147. typedef void (**VoidFuncArray)();    /* MDW: Mon Jun 22 15:30:03 1992 */
  148.